import { createRouter, createWebHashHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import LoginIndex from '../views/LoginIndex.vue'
import routers from './WebPageManagement'// 网页管理路由
import { getTimeChaoyue } from '@/utils/help'
const routes = getTimeChaoyue()
const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: routes.length == 0 ? [
    {
      path: '/',
      name: 'login',
      component: LoginIndex
    },
    {
      path: '/home',
      name: 'home',
      component: HomeView,
      redirect: '/AppealAndOpinion/FeedbackList',
      children: [
        ...routers
      ]
    },
    {
      path: '/ceshi',
      name: 'ceshi',
      component: () => import('../views/ceshi.vue')
    }
  ] : routes
})
export default router
